$(document).ready(function(e) {
    DefineNav();
    SetHeight();
});
function DefineNav()
{
	$("#nav ul li").each(function(i) {
		if($(this).attr("class")!="Selected"){
	        $(this).hover(
				function(){
					$(this).children(".po1").show();
					$(this).children(".introduce").show();
					$(this).addClass("Selected");
					$(this).children("a").addClass("Selected");
				}
				,function(){
					$(this).children(".po1").hide();
					$(this).children(".introduce").hide();
					$(this).removeClass("Selected");
					$(this).children("a").removeClass("Selected");
				}
			);
		}
		else{
	        $(this).hover(
				function(){
					$(this).children(".po1").show();
					$(this).children(".introduce").show();
				}
				,function(){
					$(this).children(".po1").hide();
					$(this).children(".introduce").hide();
				}
			);			
		}
    });
}
function SetHeight(){
	if($("#left_nav").length>0&&$("#right_contain").length>0){
		var LeftHeight = $("#left_nav").height();
		var RightHeight=$("#right_contain").height();
		if(RightHeight>LeftHeight){
			$("#left_nav").css("height",RightHeight);
		}
	}
}
//设为主页
function SetHome(obj) {
    var url = "http://www.boncontact.com/";
    try {
        obj.style.behavior = 'url(#default#homepage)'; obj.setHomePage(url);
    }
    catch (e) {
        if (window.netscape) {
            try {
                netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
            }
            catch (e) {
                alert("此操作被浏览器拒绝！\n请在浏览器地址栏输入\"about:config\"并回车\n然后将 [signed.applets.codebase_principal_support]的值设置为'true',双击即可。");
            }
            var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
            prefs.setCharPref('browser.startup.homepage', url);
        }
    }
}
//加入收藏夹
function AddFavorite() {
    var url = "http://www.boncontact.com/";
    var title = "瑞邦晟达科技（北京）有限公司";
    try {
        window.external.addFavorite(url, title);
    }
    catch (e) {
        try {
            window.sidebar.addPanel(title, url, "");
        }
        catch (e) {
            alert("加入收藏失败，请使用Ctrl+D进行添加");
        }
    }
}